<?php
	abstract class Abstract_Controller_Front extends Zend_Controller_Action
	{
		public function preDispatch()
		{
			$categoryMapper = new Model_CategoryMapper();
			foreach($categoryMapper->findByIdParent(0) as $mainPosition)
			{
				$subPositions = $categoryMapper->findByIdParent($mainPosition->getId());
				foreach($subPositions as $subPosition)
				{
					$subMenu[] = array('name' => $subPosition->getName(), 'id' => $subPosition->getId());
				}
				$menu[] = array('name' => $mainPosition->getName(), 
								'id' => $mainPosition->getId(), 
								'items' => $subMenu
				);	
			}
			$this -> view -> menu = $menu;
		}
	}